package com.example.demo.service;

import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.beanutils.BeanComparator;
import org.apache.commons.collections.ComparatorUtils;
import org.apache.commons.collections.comparators.ComparableComparator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.demo.controller.SaleComputerController;
import com.example.demo.custom.AjaxResult;
import com.example.demo.entity.CarsOrder2;
import com.example.demo.entity.NewCar1;
import com.example.demo.entity.NewCar2;
import com.example.demo.entity.RenYuanPaiMing;
import com.example.demo.entity.SysUser;
import com.example.demo.entity.ZhuZhuangTu;

@Service
public class XiaoShouBuZuiZhongTuBiaoService {
	@Autowired
	private XiaoShouBuZuiZhongTuBiaoService zuizhongService;
	@Autowired
	private SaleComputerService saleService;
	@Autowired
	private NewCar1Service carservice1;
	@Autowired
	private NewCar2Service carservice2;

	@Autowired
	private SysUserService sysUserService;
	@Autowired
	private CarsOrder2Service carorderService2;
	@Autowired
	private CarsOrderService carorderService1;

	/**
	 * @return 销售部车辆销售台数TOP4(本年)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/cheLiangXiaoShouPaiMing")
	public Object cheLiangXiaoShouPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.newCarNums(sysUser, beginDate1, enDate1);
			Integer month = date.getMonth() + 1;
			Date beginDate2 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate2 = new Date();
			if (month == 2) {
				enDate2 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate2 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate2 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			Integer carNums2 = saleService.newCarNums(sysUser, beginDate2, enDate2);
			nums2.add(carNums2);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			ren.setNum2(nums2.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearch(paiming);
		return (paiming);

	}

	/**
	 * @return 销售部车辆销售收入TOP4
	 * @throws ParseException
	 */
	@RequestMapping(value = "/cheLiangXiaoShouShouRuPaiMing")
	public Object XiaoShouShouRuTop() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
			Integer month = date.getMonth() + 1;
			Date beginDate2 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate2 = new Date();
			if (month == 2) {
				enDate2 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate2 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate2 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			Integer carNums2 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate2, enDate2);
			nums2.add(carNums2);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			paiming.add(ren);
			paiming.get(i).setSysuer(sysuers.get(i));
			paiming.get(i).setNum1(nums.get(i).toString().replace(" ", ""));
			paiming.get(i).setNum2(nums2.get(i).toString().replace(" ", ""));
		}
		paiming = RenYuansearch(paiming);
		return (paiming);

	}

	/**
	 * @return 销售部衍生销售收入TOP4
	 * @throws ParseException
	 */

	@RequestMapping(value = "/XiaoShouYanShengShouRuTop")
	public Object XiaoShouYanShengShouRuTop() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
			Integer month = date.getMonth() + 1;
			Date beginDate2 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate2 = new Date();
			if (month == 2) {
				enDate2 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate2 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate2 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			Integer carNums2 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
			nums2.add(carNums2);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			paiming.add(ren);
			paiming.get(i).setSysuer(sysuers.get(i));
			paiming.get(i).setNum1(nums.get(i).toString());
			paiming.get(i).setNum2(nums2.get(i).toString());
		}
		paiming = RenYuansearch(paiming);
		return (paiming);

	}

	/**
	 * @return 销售部年度销售台数一览（实际）（分12个月）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/nianDuZongHeShouRuShiJi")
	public Object XiaoShouBuNianDuZongHeShouRuShiJi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.newCarNums(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		List<ZhuZhuangTu> yuefenCHuli = (List<ZhuZhuangTu>) YuefenCHuli(nums);
		return yuefenCHuli;

	}

	/**
	 * @return 销售部年度销售台数一览（目标）（分12个月）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/nianDuZongHeShouRuMuBiao")
	public Object XiaoShouBuNianDuZongHeShouRuMuBiao() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				} else if (i == 2) {
					Integer a = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					eryue1 += a;
				} else if (i == 3) {
					Integer b = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					sanyue1 += b;
				} else if (i == 4) {
					Integer c = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					siyue1 += c;
				}
				if (i == 5) {
					Integer ddd = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					wuyue1 += ddd;
				}
				if (i == 6) {
					Integer w = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					liuyue1 += w;
				}
				if (i == 7) {
					Integer q = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					qiyue1 += q;
				}
				if (i == 8) {
					Integer aa = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					bayue1 += aa;
				}
				if (i == 9) {
					Integer aaa = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					jiuyue1 += aaa;
				}
				if (i == 10) {
					Integer dd = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					shiyue1 += dd;
				}
				if (i == 11) {
					Integer ww = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					shiyi += ww;
				}
				if (i == 12) {
					Integer ee = saleService.XinCheJiaoFuMuBiaoTaiShu(sysUser, beginDate1, enDate1);
					shier += ee;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部人员状况 (按年)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/YearXiaoShouBuRenYuan")
	public Object YearXiaoShouBuRenYuan() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Object> nums = new ArrayList();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer zaizhi = 0;
		Integer lizhi = 0;
		Integer xinzeng = 0;
		double liushilv = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date startTime = dateformat.parse(year + "-01-01 00:00:00");
			Date endTime = dateformat.parse(year + "-12-31 00:00:00");
			if (sysUser.getEndDay() != null) {
				if (saleService.isEffectiveDate(sysUser.getEndDay(), startTime, endTime)) {
					lizhi++;
				}
			} else if (sysUser.getEndDay() == null) {
				if (saleService.isEffectiveDate(sysUser.getStartDay(), startTime, endTime)) {
					xinzeng++;
				}
			}
			if (sysUser.getEndDay() == null) {
				zaizhi++;
			}
		}
		float li = lizhi;
		float xin = xinzeng;
		float zai = zaizhi;
		liushilv = li / (zai + xin);
		nums.add(zaizhi);
		nums.add(lizhi);
		nums.add(xinzeng);
		nums.add(liushilv);
		return (nums);
	}

	/**
	 * @return 销售部人员状况 (按月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MonthXiaoShouBuRenYuan")
	public Object MonthXiaoShouBuRenYuan() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Object> nums = new ArrayList();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer zaizhi = 0;
		Integer lizhi = 0;
		Integer xinzeng = 0;
		double liushilv = 0;
		for (SysUser sysUser : list) {

			Integer year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			Date startTime = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date endTime = new Date();
			if (month == 2) {
				endTime = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				endTime = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				endTime = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			if (sysUser.getEndDay() != null) {
				if (saleService.isEffectiveDate(sysUser.getEndDay(), startTime, endTime)) {
					lizhi++;
				}
			} else if (sysUser.getEndDay() == null) {
				if (saleService.isEffectiveDate(sysUser.getStartDay(), startTime, endTime)) {
					xinzeng++;
				}
			}
			if (sysUser.getEndDay() == null) {
				zaizhi++;
			}
		}
		float li = lizhi;
		float xin = xinzeng;
		float zai = zaizhi;
		liushilv = li / (zai + xin);
		nums.add(zaizhi);
		nums.add(lizhi);
		nums.add(xinzeng);
		nums.add(liushilv);
		return (nums);
	}

	/**
	 * @return 车辆库存时间数量(燃油车数量)
	 */
	@RequestMapping(value = "/cheLiangKuCunShiJianShuLiang")
	public Object cheLiangKuCunShiJianShuLiang() {
		Date date = new Date();
		List<Object> zong = new ArrayList<Object>();
		List<NewCar1> list = carservice1.findAll();
		Integer id = 0;
		int one = 0;
		int er = 0;
		int si = 0;
		int wu = 0;
		int san = 0;
		int liu = 0;
		int qi = 0;
		int ba = 0;
		int jiu = 0;
		int shi = 0;
		int shiyi = 0;
		for (NewCar1 newCar1 : list) {
			List<NewCar2> list2 = carservice2.findByNewCar(newCar1);
			for (NewCar2 newCar2 : list2) {
				if ("燃油车".equals(newCar2.getType())) {
					id = 0;
					Integer id2 = newCar2.getId();
					if (id2 > id) {
						id = id2;
					}
				}
			}
			NewCar2 newCar2 = carservice2.findById(id);
			if (newCar2 == null) {
				continue;
			}
			long da = (date.getTime() - newCar2.getDate().getTime()) / (3600 * 24 * 1000);
			if (da < 30) {
				one += newCar2.getMany();
			} else if (da > 29 && da < 40) {
				er += newCar2.getMany();
			} else if (da > 39 && da < 50) {
				san += newCar2.getMany();
			} else if (da > 49 && da < 60) {
				si += newCar2.getMany();
			} else if (da > 59 && da < 70) {
				wu += newCar2.getMany();
			} else if (da > 69 && da < 80) {
				liu += newCar2.getMany();
			} else if (da > 79 && da < 90) {
				qi += newCar2.getMany();
			} else if (da > 89 && da < 100) {
				ba += newCar2.getMany();
			} else if (da > 99 && da < 110) {
				jiu += newCar2.getMany();
			} else if (da > 109 && da < 120) {
				shi += newCar2.getMany();
			} else if (da > 119) {
				shiyi += newCar2.getMany();
			}
		}
		zong.add(one);
		zong.add(er);
		zong.add(san);
		zong.add(si);
		zong.add(wu);
		zong.add(liu);
		zong.add(qi);
		zong.add(ba);
		zong.add(jiu);
		zong.add(shi);
		zong.add(shiyi);
		return (zong);
	}

	/**
	 * @return 车辆库存时间数量(新能源车数量)
	 */
	@RequestMapping(value = "/cheLiangKuCunShiJianShuLiangXinNengYuan")
	public Object cheLiangKuCunShiJianShuLiangXinNengYuan() {
		Date date = new Date();
		List<Object> zong = new ArrayList<Object>();
		List<NewCar1> list = carservice1.findAll();
		Integer id = 0;
		int one = 0;
		int er = 0;
		int si = 0;
		int wu = 0;
		int san = 0;
		int liu = 0;
		int qi = 0;
		int ba = 0;
		int jiu = 0;
		int shi = 0;
		int shiyi = 0;
		for (NewCar1 newCar1 : list) {
			List<NewCar2> list2 = carservice2.findByNewCar(newCar1);
			for (NewCar2 newCar2 : list2) {
				if ("新能源车".equals(newCar2.getType())) {
					id = 0;
					Integer id2 = newCar2.getId();
					if (id2 > id) {
						id = id2;
					}
				} else {
					continue;
				}
			}
			NewCar2 newCar2 = carservice2.findById(id);
			if (newCar2 == null) {
				continue;
			}
			long da = (date.getTime() - newCar2.getDate().getTime()) / (3600 * 24 * 1000);
			if (da < 30) {
				one += newCar2.getMany();
			} else if (da > 29 && da < 40) {
				er += newCar2.getMany();
			} else if (da > 39 && da < 50) {
				san += newCar2.getMany();
			} else if (da > 49 && da < 60) {
				si += newCar2.getMany();
			} else if (da > 59 && da < 70) {
				wu += newCar2.getMany();
			} else if (da > 69 && da < 80) {
				liu += newCar2.getMany();
			} else if (da > 79 && da < 90) {
				qi += newCar2.getMany();
			} else if (da > 89 && da < 100) {
				ba += newCar2.getMany();
			} else if (da > 99 && da < 110) {
				jiu += newCar2.getMany();
			} else if (da > 109 && da < 120) {
				shi += newCar2.getMany();
			} else if (da > 119) {
				shiyi += newCar2.getMany();
			}
		}
		zong.add(one);
		zong.add(er);
		zong.add(san);
		zong.add(si);
		zong.add(wu);
		zong.add(liu);
		zong.add(qi);
		zong.add(ba);
		zong.add(jiu);
		zong.add(shi);
		zong.add(shiyi);
		return (zong);
	}

	/**
	 * @return 车辆库存时间数量 (新能源车金额)
	 */
	@RequestMapping(value = "/cheLiangKuCunShiJianShuLiangXinNengYuanJinE")
	public Object cheLiangKuCunShiJianShuLiangXinNengYuanJinE() {
		Date date = new Date();
		List<Object> zong = new ArrayList<Object>();
		List<NewCar1> list = carservice1.findAll();
		Integer id = 0;
		int one = 0;
		int er = 0;
		int si = 0;
		int wu = 0;
		int san = 0;
		int liu = 0;
		int qi = 0;
		int ba = 0;
		int jiu = 0;
		int shi = 0;
		int shiyi = 0;
		for (NewCar1 newCar1 : list) {
			List<NewCar2> list2 = carservice2.findByNewCar(newCar1);
			for (NewCar2 newCar2 : list2) {
				if ("新能源车".equals(newCar2.getType())) {
					id = 0;
					Integer id2 = newCar2.getId();
					if (id2 > id) {
						id = id2;
					}
				} else {
					continue;
				}
			}
			NewCar2 newCar2 = carservice2.findById(id);
			if (newCar2 == null) {
				continue;
			}
			long da = (date.getTime() - newCar2.getDate().getTime()) / (3600 * 24 * 1000);
			if (da < 30) {
				one += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 29 && da < 40) {
				er += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 39 && da < 50) {
				san += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 49 && da < 60) {
				si += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 59 && da < 70) {
				wu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 69 && da < 80) {
				liu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 79 && da < 90) {
				qi += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 89 && da < 100) {
				ba += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 99 && da < 110) {
				jiu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 109 && da < 120) {
				shi += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 119) {
				shiyi += newCar2.getMany() * newCar2.getTiCheMoney();
			}
		}
		zong.add(one);
		zong.add(er);
		zong.add(san);
		zong.add(si);
		zong.add(wu);
		zong.add(liu);
		zong.add(qi);
		zong.add(ba);
		zong.add(jiu);
		zong.add(shi);
		zong.add(shiyi);
		return (zong);
	}

	/**
	 * @return 车辆库存时间数量 (燃油车金额)
	 */
	@RequestMapping(value = "/cheLiangKuCunShiJianShuLiangRanYouCheJinE")
	public Object cheLiangKuCunShiJianShuLiangRanYouCheJinE() {
		Date date = new Date();
		List<Object> zong = new ArrayList<Object>();
		List<NewCar1> list = carservice1.findAll();
		Integer id = 0;
		int one = 0;
		int er = 0;
		int si = 0;
		int wu = 0;
		int san = 0;
		int liu = 0;
		int qi = 0;
		int ba = 0;
		int jiu = 0;
		int shi = 0;
		int shiyi = 0;
		for (NewCar1 newCar1 : list) {
			List<NewCar2> list2 = carservice2.findByNewCar(newCar1);
			for (NewCar2 newCar2 : list2) {
				if ("燃油车".equals(newCar2.getType())) {
					id = 0;
					Integer id2 = newCar2.getId();
					if (id2 > id) {
						id = id2;
					}
				} else {
					continue;
				}
			}
			NewCar2 newCar2 = carservice2.findById(id);
			if (newCar2 == null) {
				continue;
			}
			long da = (date.getTime() - newCar2.getDate().getTime()) / (3600 * 24 * 1000);
			if (da < 30) {
				one += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 29 && da < 40) {
				er += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 39 && da < 50) {
				san += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 49 && da < 60) {
				si += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 59 && da < 70) {
				wu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 69 && da < 80) {
				liu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 79 && da < 90) {
				qi += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 89 && da < 100) {
				ba += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 99 && da < 110) {
				jiu += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 109 && da < 120) {
				shi += newCar2.getMany() * newCar2.getTiCheMoney();
			} else if (da > 119) {
				shiyi += newCar2.getMany() * newCar2.getTiCheMoney();
			}
		}
		zong.add(one);
		zong.add(er);
		zong.add(san);
		zong.add(si);
		zong.add(wu);
		zong.add(liu);
		zong.add(qi);
		zong.add(ba);
		zong.add(jiu);
		zong.add(shi);
		zong.add(shiyi);
		return (zong);
	}

	/**
	 * @return 销售部转介绍车辆销售台数TOP4(人员排名)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/ZhuanJieShaoCheLiangXiaoShouTaiShuPaiMing")
	public Object ZhuanJieShaoCheLiangXiaoShouTaiShuPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.ZhuanJieShao(sysUser, beginDate1, enDate1);
			Integer month = date.getMonth() + 1;
			Date beginDate2 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate2 = new Date();
			if (month == 2) {
				enDate2 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate2 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate2 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			Integer carNums2 = saleService.ZhuanJieShao(sysUser, beginDate2, enDate2);
			nums2.add(carNums2);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			ren.setNum2(nums2.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearch(paiming);
		return (paiming);

	}

	/**
	 * @return 销售部衍生业务本月收入对比（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/BenYueYanShengXiangMuShouRuDuiBi")
	public Object BenYueYanShengXiangMuShouRuDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate1 = new Date();
			if (month == 2) {
				enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			if (saleService.newCarBaoYangTaoCanShouRu(sysUser, beginDate1, enDate1) == null) {
				continue;
			}
			SHangyeXian += saleService.newCarShangYeXianShouRu(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongShouRu(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouShouRu(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanShouRu(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoShouRu(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiShouRu(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianShouRu(sysUser, beginDate1, enDate1);
		}
		map.put("商业险收入", (int) SHangyeXian);
		map.put("交强险收入", (int) jiaoQiangXian);
		map.put("金融收入", (int) JinRong);
		map.put("精品收入", (int) jingpin);
		map.put("保养套餐收入", (int) baoyang);
		map.put("延保收入", (int) yanbao);
		map.put("代办上牌收入", (int) daiban);
		name.add("商业险收入");
		name.add("交强险收入");
		name.add("金融收入");
		name.add("精品收入");
		name.add("保养套餐收入");
		name.add("延保收入");
		name.add("代办上牌收入");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);
	}

	/**
	 * @return 销售部车辆业务本年度月收入对比（万元）(12月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuCheLiangYeWuBenNianDuYueSHouRUDuiBi")
	public Object XiaoShouBuCheLiangYeWuBenNianDuYueSHouRUDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部衍生业务本年度月收入对比（万元）(12月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuYanShengYeWuBenNianDuYueSHouRUDuiBi")
	public Object XiaoShouBuYanShengYeWuBenNianDuYueSHouRUDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = (int) saleService.YanShengYeWuZongHeShouRu(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部车辆业务本月收入对比（万元） 每个车型收入，折线图或柱形图
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MeiGeCheXingShouRuTu")
	public Object MeiGeCheXingShouRuTu() throws ParseException {
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		List<Integer> nums = new ArrayList<Integer>();
		Integer num = 0;
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				int year = date.getYear() + 1900;
				Integer month = date.getMonth() + 1;
				Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
				Date enDate1 = new Date();
				if (month == 2) {
					enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
				} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
						|| month == 12) {
					enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
				} else {
					enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
				}
				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);
			}
			name.add(newCar1.getName());
			nums.add(num);
			map.put(newCar1.getName(), num);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);
	}

	/**
	 * @return 车辆年度收入TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MeiGeCheXingShouRuTuPaiMing")
	public Object MeiGeCheXingShouRuTuPaiMing() throws ParseException {
		Map<String, String> map = new LinkedHashMap<String, String>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<String> nums = new ArrayList<String>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				Integer year = date.getYear() + 1900;
				Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(res);
			map.put(newCar1.getName(), res);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i));
		}
		zhus = ZhuZHuangTusearch(zhus);
		return (zhus);
	}

	/**
	 * @return 衍生年度收入TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/YanShengNianDUShouRuPaiMing")
	public Object YanShengNianDUShouRuPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			SHangyeXian += saleService.newCarShangYeXianShouRu(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongShouRu(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouShouRu(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanShouRu(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoShouRu(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiShouRu(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianShouRu(sysUser, beginDate1, enDate1);
		}
		name.add("商业险收入");
		name.add("交强险收入");
		name.add("金融收入");
		name.add("精品收入");
		name.add("保养套餐收入");
		name.add("延保收入");
		name.add("代办上牌收入");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);

		for (int i = 0; i < nums.size() - 1; i++) {
			for (int j = 0; j < nums.size() - 1 - i; j++) {
				if (nums.get(j) < nums.get(j + 1)) {
					int temp = nums.get(j);
					String car = name.get(j);
					nums.set(j, nums.get(j + 1));
					name.set(j, name.get(j + 1));
					nums.set(j + 1, temp);
					name.set(j + 1, car);
				}
			}
		}
		for (int i = 0; i < nums.size(); i++) {
			map.put(name.get(i), nums.get(i));
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);

	}

	/**
	 * @return 销售部车辆业务本年度月毛利率对比(12个月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuCheLiangYeWuBenNianDuYueMaoLiLVDuiBi")
	public Object XiaoShouBuCheLiangYeWuBenNianDuYueMaoLiLVDuiBi() throws ParseException {
		List<Float> nums = new ArrayList<Float>();
		List<Integer> list = (List<Integer>) XiaoShouBuCheLiangYeWuBenNianDuYueSHouRUDuiBi();
		List<Integer> list2 = (List<Integer>) xiaoshoubuCheLiangYeWuBennianDuYueMaoLiDuiBi();
		for (int i = 0; i < list.size(); i++) {
			if (list.get(i) != 0) {
				float a = list.get(i);
				float b = list2.get(i);
				nums.add(b / a);
			} else {
				nums.add((float) 0);
			}

		}
		return (nums);

	}

	/**
	 * @return 销售部衍生业务本年度月毛利率对比（万元）(12个月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuYanShengYeWuBenNianDuYueMaoLiLVDuiBi")
	public Object XiaoShouBuYanShengYeWuBenNianDuYueMaoLiLVDuiBi() throws ParseException {
		List<Float> nums = new ArrayList<Float>();
		List<Integer> list = (List<Integer>) XiaoShouBuYanShengYeWuBenNianDuYueSHouRUDuiBi();
		List<Integer> list2 = (List<Integer>) XiaoShouBuYanShengYeWubennianduYueMaoliDuiBi();
		for (int i = 0; i < list.size(); i++) {
			if (list.get(i) != 0) {
				float a = list.get(i);
				float b = list2.get(i);
				nums.add(b / a);
			} else {
				nums.add((float) 0);
			}

		}
		return (nums);

	}

	/**
	 * @return 销售部车辆业务本月成本对比（万元） 每个车型成本，折线图或柱形图
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MeiGeCheXingCHengBenTu")
	public Object MeiGeCheXingCHengBenTu() throws ParseException {
		Map<String, String> map = new LinkedHashMap<String, String>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<String> nums = new ArrayList<String>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				int year = date.getYear() + 1900;
				Integer month = date.getMonth() + 1;
				Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
				Date enDate1 = new Date();
				if (month == 2) {
					enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
				} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
						|| month == 12) {
					enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
				} else {
					enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
				}
				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(res);
			map.put(newCar1.getName(), res);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i));
		}
		return (zhus);
	}

	/**
	 * @return 车辆年度成本TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/CHeLiangNianDuChengBenPaiMing")
	public Object CHeLiangNianDuChengBenPaiMing() throws ParseException {
		Map<String, String> map = new LinkedHashMap<String, String>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<String> nums = new ArrayList<String>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				Integer year = date.getYear() + 1900;
				Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(res);
			map.put(newCar1.getName(), res);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i));
		}
		zhus = ZhuZHuangTusearch(zhus);
		return (zhus);
	}

	/**
	 * @return 车辆年度毛利TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/CHeLiangNianDuMaoLiPaiMing")
	public Object CHeLiangNianDuMaoLiPaiMing() throws ParseException {
		Map<String, String> map = new LinkedHashMap<String, String>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<String> nums = new ArrayList<String>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				Integer year = date.getYear() + 1900;
				Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(res);
			map.put(newCar1.getName(), res);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i));
		}
		zhus = ZhuZHuangTusearch(zhus);
		return (zhus);
	}

	/**
	 * @return 车辆年度毛利率TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/CHeLiangNianDuMaoLiLvPaiMing")
	public Object CHeLiangNianDuMaoLiLvPaiMing() throws ParseException {
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<Float> nums = new ArrayList<Float>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				Integer year = date.getYear() + 1900;
				Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num = saleService.XincheXiaoShouMaoLiLv(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(num);
			map.put(newCar1.getName(), num);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i).toString());
		}
		zhus = ZhuZHuangTusearch(zhus);
		return (zhus);
	}

	/**
	 * @return 衍生年度成本TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/YanShengNianDUChengBenPaiMing")
	public Object YanShengNianDUChengBenPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

			SHangyeXian += saleService.newCarShangYeXianChengBen(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongChengBen(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouChengBen(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanChengBen(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoChengBen(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiChengBen(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianChengBen(sysUser, beginDate1, enDate1);

		}
		name.add("商业险成本");
		name.add("交强险成本");
		name.add("金融成本");
		name.add("精品成本");
		name.add("保养套餐成本");
		name.add("延保成本");
		name.add("代办上牌成本");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);

		for (int i = 0; i < nums.size() - 1; i++) {
			for (int j = 0; j < nums.size() - 1 - i; j++) {
				if (nums.get(j) < nums.get(j + 1)) {
					int temp = nums.get(j);
					String car = name.get(j);
					nums.set(j, nums.get(j + 1));
					name.set(j, name.get(j + 1));
					nums.set(j + 1, temp);
					name.set(j + 1, car);
				}
			}
		}
		for (int i = 0; i < nums.size(); i++) {
			map.put(name.get(i), nums.get(i));
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);

	}

	/**
	 * @return 衍生年度毛利TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/YanShengNianDUMaoliPaiMing")
	public Object YanShengNianDUMaoliPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

			SHangyeXian += saleService.newCarShangYeXianMaoLi(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongFuWuMaoLi(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouMaoLi(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanMaoLi(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoMaoLi(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiMaoLi(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianMaoLi(sysUser, beginDate1, enDate1);

		}
		name.add("商业险毛利");
		name.add("交强险毛利");
		name.add("金融毛利");
		name.add("精品毛利");
		name.add("保养套餐毛利");
		name.add("延保毛利");
		name.add("代办上牌毛利");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);

		for (int i = 0; i < nums.size() - 1; i++) {
			for (int j = 0; j < nums.size() - 1 - i; j++) {
				if (nums.get(j) < nums.get(j + 1)) {
					int temp = nums.get(j);
					String car = name.get(j);
					nums.set(j, nums.get(j + 1));
					name.set(j, name.get(j + 1));
					nums.set(j + 1, temp);
					name.set(j + 1, car);
				}
			}
		}
		for (int i = 0; i < nums.size(); i++) {
			map.put(name.get(i), nums.get(i));
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);

	}

	/**
	 * @return 衍生年度毛利率TOP3（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/YanShengNianDUMaoliLvPaiMing")
	public Object YanShengNianDUMaoliLvPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<String> name = new ArrayList<String>();
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

			SHangyeXian += saleService.newCarShangYeXianMaoLiLv(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongMaoLiLv(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouMaoLiLv(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanMaoLiLv(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoMaoLiLv(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiMaoLiLv(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianMaoLiLv(sysUser, beginDate1, enDate1);

		}
		name.add("商业险毛利率");
		name.add("交强险毛利率");
		name.add("金融毛利率");
		name.add("精品毛利率");
		name.add("保养套餐毛利率");
		name.add("延保毛利率");
		name.add("代办上牌毛利率");
		nums.add(SHangyeXian);
		nums.add(jiaoQiangXian);
		nums.add(JinRong);
		nums.add(jingpin);
		nums.add(baoyang);
		nums.add(yanbao);
		nums.add(daiban);

		for (int i = 0; i < nums.size() - 1; i++) {
			for (int j = 0; j < nums.size() - 1 - i; j++) {
				if (nums.get(j) < nums.get(j + 1)) {
					Float temp = nums.get(j);
					String car = name.get(j);
					nums.set(j, nums.get(j + 1));
					name.set(j, name.get(j + 1));
					nums.set(j + 1, temp);
					name.set(j + 1, car);
				}
			}
		}
		for (int i = 0; i < nums.size(); i++) {
			map.put(name.get(i), nums.get(i));
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i).toString());
		}
		return (zhus);

	}

	/**
	 * @return 销售部车辆业务本年度月毛利对比（万元）
	 * @throws ParseException
	 */
	public Object xiaoshoubuCheLiangYeWuBennianDuYueMaoLiDuiBi() throws ParseException {
		List<Integer> sHouRUDuiBi = (List<Integer>) XiaoShouBuCheLiangYeWuBenNianDuYueSHouRUDuiBi();
		List<Integer> maoli = new ArrayList<Integer>();
		List<Integer> chengben = (List<Integer>) xiaoshoubuCheLiangYeWuBennianDuYueChengBenDuiBi();
		for (int i = 0; i < sHouRUDuiBi.size(); i++) {
			maoli.add(sHouRUDuiBi.get(i) - chengben.get(i));
		}
		return (maoli);
	}

	/**
	 * @return 销售部衍生业务本年度月毛利对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuYanShengYeWubennianduYueMaoliDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1));
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部车辆业务本年度月成本对比（万元）
	 * @throws ParseException
	 */
	public Object xiaoshoubuCheLiangYeWuBennianDuYueChengBenDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);

	}

	/**
	 * @return 销售部衍生业务本年度月成本对比（万元）(12月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuYanShengYeWuBenNianDuYueChengBenDuiBi")
	public Object XiaoShouBuYanShengYeWuBenNianDuYueChengBenDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = (int) (saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1)
							- saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1));
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部衍生业务本月成本对比（万元）
	 * @throws ParseException
	 */
	@RequestMapping(value = "/BenYueYanShengXiangMuChengBenDuiBi")
	public Object BenYueYanShengXiangMuChengBenDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate1 = new Date();
			if (month == 2) {
				enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			SHangyeXian += saleService.newCarShangYeXianChengBen(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongChengBen(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouChengBen(sysUser, beginDate1, enDate1);
			if (saleService.newCarBaoYangTaoCanChengBen(sysUser, beginDate1, enDate1) == null) {
				continue;
			}
			baoyang += saleService.newCarBaoYangTaoCanChengBen(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoChengBen(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiChengBen(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianChengBen(sysUser, beginDate1, enDate1);
		}
		map.put("商业险成本", (int) SHangyeXian);
		map.put("交强险成本", (int) jiaoQiangXian);
		map.put("金融成本", (int) JinRong);
		map.put("精品成本", (int) jingpin);
		map.put("保养套餐成本", (int) baoyang);
		map.put("延保成本", (int) yanbao);
		map.put("代办上牌成本", (int) daiban);
		name.add("商业险成本");
		name.add("交强险成本");
		name.add("金融成本");
		name.add("精品成本");
		name.add("保养套餐成本");
		name.add("延保成本");
		name.add("代办上牌成本");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);
	}

	/**
	 * @return 销售部车辆业务本月毛利对比（万元） 每个车型收入，折线图或柱形图
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MeiGeCheXingMaoLiTu")
	public Object MeiGeCheXingMaoLiTu() throws ParseException {

		Map<String, String> map = new LinkedHashMap<String, String>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<String> nums = new ArrayList<String>();
		float num = 0;
		Integer cost = 0;
		for (NewCar1 newCar1 : carservice1.findAll()) {
			num = 0;
			List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
			for (CarsOrder2 carsOrder2 : list2) {
				if (carsOrder2.getXiaoShouPrice() == null) {
					continue;
				}
				int year = date.getYear() + 1900;
				Integer month = date.getMonth() + 1;
				Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
				Date enDate1 = new Date();
				if (month == 2) {
					enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
				} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
						|| month == 12) {
					enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
				} else {
					enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
				}
				SysUser sysUser = carsOrder2.getCarsorder().getUserId();
				num += saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1);

			}
			name.add(newCar1.getName());
			BigDecimal bg = new BigDecimal(num + "");
			DecimalFormat df = new DecimalFormat("0.00");
			String res = df.format(bg);
			nums.add(res);
			map.put(newCar1.getName(), res);
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i));
		}
		return (zhus);

	}

	/**
	 * @return 销售部衍生业务本月毛利对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuYanShengYeWuBenyueMaoliDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Map<String, Integer> map = new LinkedHashMap<String, Integer>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate1 = new Date();
			if (month == 2) {
				enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			SHangyeXian += saleService.newCarShangYeXianMaoLi(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongFuWuMaoLi(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouMaoLi(sysUser, beginDate1, enDate1);
			if (saleService.newCarBaoYangTaoCanMaoLi(sysUser, beginDate1, enDate1) == null) {
				continue;
			}
			baoyang += saleService.newCarBaoYangTaoCanMaoLi(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoMaoLi(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiMaoLi(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianMaoLi(sysUser, beginDate1, enDate1);
		}
		map.put("商业险毛利", (int) SHangyeXian);
		map.put("交强险毛利", (int) jiaoQiangXian);
		map.put("金融毛利", (int) JinRong);
		map.put("精品毛利", (int) jingpin);
		map.put("保养套餐毛利", (int) baoyang);
		map.put("延保毛利", (int) yanbao);
		map.put("代办上牌毛利", (int) daiban);
		name.add("商业险毛利");
		name.add("交强险毛利");
		name.add("金融毛利");
		name.add("精品毛利");
		name.add("保养套餐毛利");
		name.add("延保毛利");
		name.add("代办上牌毛利");
		nums.add((int) SHangyeXian);
		nums.add((int) jiaoQiangXian);
		nums.add((int) JinRong);
		nums.add((int) jingpin);
		nums.add((int) baoyang);
		nums.add((int) yanbao);
		nums.add((int) daiban);
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setNumber(nums.get(i));
		}
		return (zhus);

	}

	/**
	 * @return 销售部衍生业务本月毛利率对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuYanShengYeWuBenyueMaoliLvDuiBi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<String> name = new ArrayList<String>();
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		float jiaoQiangXian = 0;
		float SHangyeXian = 0;
		float JinRong = 0;
		float jingpin = 0;
		float baoyang = 0;
		float yanbao = 0;
		float daiban = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			Date beginDate1 = dateformat.parse(year + "-" + month + "-01 00:00:00");
			Date enDate1 = new Date();
			if (month == 2) {
				enDate1 = dateformat.parse(year + "-" + month + "-28 00:00:00");
			} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10
					|| month == 12) {
				enDate1 = dateformat.parse(year + "-" + month + "-31 00:00:00");
			} else {
				enDate1 = dateformat.parse(year + "-" + month + "-30 00:00:00");
			}
			SHangyeXian += saleService.newCarShangYeXianMaoLiLv(sysUser, beginDate1, enDate1);
			JinRong += saleService.newCarJinRongMaoLiLv(sysUser, beginDate1, enDate1);
			jingpin += saleService.newCarJingPinXiaoShouMaoLiLv(sysUser, beginDate1, enDate1);
			baoyang += saleService.newCarBaoYangTaoCanMaoLiLv(sysUser, beginDate1, enDate1);
			yanbao += saleService.newCarYanBaoMaoLiLv(sysUser, beginDate1, enDate1);
			daiban += saleService.newCarDaiBanShangPaiMaoLiLv(sysUser, beginDate1, enDate1);
			jiaoQiangXian += saleService.newCarJiaoQiangXianMaoLiLv(sysUser, beginDate1, enDate1);

		}
		name.add("商业险毛利率");
		name.add("交强险毛利率");
		name.add("金融毛利率");
		name.add("精品毛利率");
		name.add("保养套餐毛利率");
		name.add("延保毛利率");
		name.add("代办上牌毛利率");
		nums.add(SHangyeXian);
		nums.add(jiaoQiangXian);
		nums.add(JinRong);
		nums.add(jingpin);
		nums.add(baoyang);
		nums.add(yanbao);
		nums.add(daiban);

		for (int i = 0; i < nums.size() - 1; i++) {
			for (int j = 0; j < nums.size() - 1 - i; j++) {
				if (nums.get(j) < nums.get(j + 1)) {
					Float temp = nums.get(j);
					String car = name.get(j);
					nums.set(j, nums.get(j + 1));
					name.set(j, name.get(j + 1));
					nums.set(j + 1, temp);
					name.set(j + 1, car);
				}
			}
		}
		for (int i = 0; i < nums.size(); i++) {
			map.put(name.get(i), nums.get(i));
		}
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i).toString());
		}
		return (zhus);

	}

	/**
	 * @return 销售部车辆业务本月毛利率对比（万元） 每个车型毛利率，折线图或柱形图
	 * @throws ParseException
	 */
	@RequestMapping(value = "/MeiGeCheXingMaoLiLvTu")
	public Object MeiGeCheXingMaoLiLvTu() throws ParseException {

		List<ZhuZhuangTu> nums = new ArrayList<ZhuZhuangTu>();
		List<ZhuZhuangTu> list = (List<ZhuZhuangTu>) MeiGeCheXingShouRuTu();
		List<ZhuZhuangTu> list2 = (List<ZhuZhuangTu>) MeiGeCheXingMaoLiTu();
		for (int i = 0; i < list.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			if (list.get(i).getNumber() != 0) {
				float a = list.get(i).getNumber();
				float b =Float.valueOf(list2.get(i).getBigNumber());
				float c = (b / a);
				zhu.setName(list.get(i).getName());
				zhu.setBigNumber("" + c);
				nums.add(zhu);
			} else {

				zhu.setName(list.get(i).getName());
				zhu.setBigNumber("0");
				nums.add(zhu);
			}

		}
		return (nums);

	}

	/**
	 * @return 销售部各岗位本年度收入对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuGeGangWeiBenNianDuShouRuDuiBi() throws ParseException {
		List<Float> ZhanTingSHouRU = (List<Float>) GangWeiShouRU("销售部", "展厅");
		List<Float> IDDCSHouRu = (List<Float>) GangWeiShouRU("销售部", "IDCC");
		List<Float> ErWangSHouRU = (List<Float>) GangWeiShouRU("销售部", "二网");
		List<Float> DaKeHuSHouru = (List<Float>) GangWeiShouRU("销售部", "大客户");
		List<List<Float>> list = new ArrayList<List<Float>>();
		list.add(ZhanTingSHouRU);
		list.add(IDDCSHouRu);
		list.add(ErWangSHouRU);
		list.add(DaKeHuSHouru);
		return list;
	}

	/**
	 * @return 销售部各岗位本年度成本对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuGeGangWeiBenNianDuChengBenDuiBi() throws ParseException {
		List<Float> ZhanTingSHouRU = (List<Float>) GangWeiCHengBen("销售部", "展厅");
		List<Float> IDDCSHouRu = (List<Float>) GangWeiCHengBen("销售部", "IDCC");
		List<Float> ErWangSHouRU = (List<Float>) GangWeiCHengBen("销售部", "二网");
		List<Float> DaKeHuSHouru = (List<Float>) GangWeiCHengBen("销售部", "大客户");
		List<List<Float>> list = new ArrayList<List<Float>>();
		list.add(ZhanTingSHouRU);
		list.add(IDDCSHouRu);
		list.add(ErWangSHouRU);
		list.add(DaKeHuSHouru);
		return list;
	}

	/**
	 * @return 销售部各岗位本年度毛利对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuGeGangWeiBenNianDuMaoLiDuiBi() throws ParseException {
		List<Float> ZhanTingSHouRU = (List<Float>) GangWeiMaoLi("销售部", "展厅");
		List<Float> IDDCSHouRu = (List<Float>) GangWeiMaoLi("销售部", "IDCC");
		List<Float> ErWangSHouRU = (List<Float>) GangWeiMaoLi("销售部", "二网");
		List<Float> DaKeHuSHouru = (List<Float>) GangWeiMaoLi("销售部", "大客户");
		List<List<Float>> list = new ArrayList<List<Float>>();
		list.add(ZhanTingSHouRU);
		list.add(IDDCSHouRu);
		list.add(ErWangSHouRU);
		list.add(DaKeHuSHouru);
		return list;
	}

	/**
	 * @return 销售部各岗位本年度毛利率对比（万元）
	 * @throws ParseException
	 */
	public Object XiaoShouBuGeGangWeiBenNianDuMaoLiLvDuiBi() throws ParseException {
		List<Float> ZhanTingSHouRU = (List<Float>) GangWeiMaoLiLv("销售部", "展厅");
		List<Float> IDDCSHouRu = (List<Float>) GangWeiMaoLiLv("销售部", "IDCC");
		List<Float> ErWangSHouRU = (List<Float>) GangWeiMaoLiLv("销售部", "二网");
		List<Float> DaKeHuSHouru = (List<Float>) GangWeiMaoLiLv("销售部", "大客户");
		List<List<Float>> list = new ArrayList<List<Float>>();
		list.add(ZhanTingSHouRU);
		list.add(IDDCSHouRu);
		list.add(ErWangSHouRU);
		list.add(DaKeHuSHouru);
		return list;
	}

	/**
	 * @return 销售部各岗位本年度收入（万元）(12个月)
	 * @throws ParseException
	 */
	public Object GangWeiShouRU(String str1, String str2) throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			if (str1.equals(sysUser.getDeptName())) {
				if (sysUser.getZhiwei().getName().contains(str2)) {
					int year = date.getYear() + 1900;
					Integer month = date.getMonth() + 1;
					int d = 30;
					for (int i = 1; i <= 12; i++) {
						if (i == 2) {
							d = 28;
						} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
							d = 31;
						} else {
							d = 30;
						}
						Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
						if (i == 1) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							yiyue += yiyue1;
						}
						if (i == 2) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							eryue1 += yiyue1;
						}
						if (i == 3) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							sanyue1 += yiyue1;
						}
						if (i == 4) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							siyue1 += yiyue1;
						}
						if (i == 5) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							wuyue1 += yiyue1;
						}
						if (i == 6) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							liuyue1 += yiyue1;
						}
						if (i == 7) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							qiyue1 += yiyue1;
						}
						if (i == 8) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							bayue1 += yiyue1;
						}
						if (i == 9) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							jiuyue1 += yiyue1;
						}
						if (i == 10) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							shiyue1 += yiyue1;
						}
						if (i == 11) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							shiyi += yiyue1;
						}
						if (i == 12) {
							float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
							shier += yiyue1;
						}
					}

				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);

	}

	/**
	 * @return 销售部各岗位本年度成本（万元）(12个月)
	 * @throws ParseException
	 */
	public Object GangWeiCHengBen(String str1, String str2) throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			if (str1.equals(sysUser.getDeptName())) {
				if (sysUser.getZhiwei().getName().contains(str2)) {
					int year = date.getYear() + 1900;
					Integer month = date.getMonth() + 1;
					int d = 30;
					for (int i = 1; i <= 12; i++) {
						if (i == 2) {
							d = 28;
						} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
							d = 31;
						} else {
							d = 30;
						}
						Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
						if (i == 1) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							yiyue += yiyue1;
						}
						if (i == 2) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							eryue1 += yiyue1;
						}
						if (i == 3) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							sanyue1 += yiyue1;
						}
						if (i == 4) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							siyue1 += yiyue1;
						}
						if (i == 5) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							wuyue1 += yiyue1;
						}
						if (i == 6) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							liuyue1 += yiyue1;
						}
						if (i == 7) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							qiyue1 += yiyue1;
						}
						if (i == 8) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							bayue1 += yiyue1;
						}
						if (i == 9) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							jiuyue1 += yiyue1;
						}
						if (i == 10) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							shiyue1 += yiyue1;
						}
						if (i == 11) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							shiyi += yiyue1;
						}
						if (i == 12) {
							float yiyue1 = saleService.XiaoShouZongHeChengBen(sysUser, beginDate1, enDate1);
							shier += yiyue1;
						}
					}

				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);

	}

	/**
	 * @return 销售部各岗位本年度毛利（万元）(12个月)
	 * @throws ParseException
	 */
	public Object GangWeiMaoLi(String str1, String str2) throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			if (str1.equals(sysUser.getDeptName())) {
				if (sysUser.getZhiwei().getName().contains(str2)) {
					int year = date.getYear() + 1900;
					Integer month = date.getMonth() + 1;
					int d = 30;
					for (int i = 1; i <= 12; i++) {
						if (i == 2) {
							d = 28;
						} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
							d = 31;
						} else {
							d = 30;
						}
						Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
						if (i == 1) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							yiyue += yiyue1;
						}
						if (i == 2) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							eryue1 += yiyue1;
						}
						if (i == 3) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							sanyue1 += yiyue1;
						}
						if (i == 4) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							siyue1 += yiyue1;
						}
						if (i == 5) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							wuyue1 += yiyue1;
						}
						if (i == 6) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							liuyue1 += yiyue1;
						}
						if (i == 7) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							qiyue1 += yiyue1;
						}
						if (i == 8) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							bayue1 += yiyue1;
						}
						if (i == 9) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							jiuyue1 += yiyue1;
						}
						if (i == 10) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							shiyue1 += yiyue1;
						}
						if (i == 11) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							shiyi += yiyue1;
						}
						if (i == 12) {
							float yiyue1 = saleService.XiaoShouZongHeMaoLi(sysUser, beginDate1, enDate1);
							shier += yiyue1;
						}
					}

				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);

	}

	/**
	 * @return 销售部各岗位本年度毛利率（万元）(12个月)
	 * @throws ParseException
	 */
	public Object GangWeiMaoLiLv(String str1, String str2) throws ParseException {
		List<Float> maolis = (List<Float>) GangWeiMaoLi(str1, str2);
		List<Float> shourus = (List<Float>) GangWeiShouRU(str1, str2);
		List<Float> maoliLv = new ArrayList<Float>();
		for (int i = 0; i < shourus.size(); i++) {
			Float shouru = shourus.get(i);
			Float maoli = shourus.get(i);
			if (shouru != 0) {
				maoliLv.add(maoli / shouru);
			} else {
				maoliLv.add((float) 0);
			}
		}
		return maoliLv;
	}

	/**
	 * @return 销售部年厂家提车目标达成情况(12月)
	 * @throws ParseException
	 */
	@RequestMapping(value = "/XiaoShouBuNianCHangJiaTiCHeMuBiaoDaChengQingKuang")
	public Object XiaoShouBuNianCHangJiaTiCHeMuBiaoDaChengQingKuang() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					float yiyue1 = saleService.XinCheJiaoFuMuBiaoTaiShuDaChengLv(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部客户线索量(12月)
	 * @throws ParseException
	 */
	public Object XiaoSHouBuKeHuXianSuoLiang() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					float yiyue1 = saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 12个月H\A\B\C客户数量，折线图或柱形图
	 * @throws ParseException
	 */
	public Object ABCHLevel() throws ParseException {
		List<Integer> h = (List<Integer>) XiaoSHouBuKeHuJiBie("H");
		List<Integer> a = (List<Integer>) XiaoSHouBuKeHuJiBie("A");
		List<Integer> b = (List<Integer>) XiaoSHouBuKeHuJiBie("B");
		List<Integer> c = (List<Integer>) XiaoSHouBuKeHuJiBie("C");
		List<List<Integer>> list = new ArrayList<List<Integer>>();
		list.add(h);
		list.add(a);
		list.add(b);
		list.add(c);
		return list;
	}

	/**
	 * @return 销售部客户级别(12月)
	 * @throws ParseException
	 */
	public Object XiaoSHouBuKeHuJiBie(String s) throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					float yiyue1 = saleService.JiBie(s, sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部邀约到店量一次
	 * @throws ParseException
	 */
	public Object XiaoSHouBuYaoYueLaiDianLiangYici() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					float yiyue1 = saleService.firstLaiDianZongHe(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部邀约到店量二次及以上
	 * @throws ParseException
	 */
	public Object XiaoSHouBuYaoYueLaiDianLiangErCi() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		float yiyue = 0;
		float eryue1 = 0;
		float sanyue1 = 0;
		float siyue1 = 0;
		float wuyue1 = 0;
		float liuyue1 = 0;
		float qiyue1 = 0;
		float bayue1 = 0;
		float jiuyue1 = 0;
		float shiyue1 = 0;
		float shiyi = 0;
		float shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					float yiyue1 = saleService.SecondTwoLaiDianZongHe(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}

	/**
	 * @return 销售部邀约到店量 12个月邀约到店量，折线图或柱形图
	 * @throws ParseException
	 */
	public Object XiaoSHouBuYaoYueLaiDianLiang() throws ParseException {
		List<Integer> erCi = (List<Integer>) XiaoSHouBuYaoYueLaiDianLiangErCi();
		List<Integer> yiCi = (List<Integer>) XiaoSHouBuYaoYueLaiDianLiangYici();
		List<List<Integer>> list = new ArrayList<List<Integer>>();
		list.add(yiCi);
		list.add(erCi);
		return list;
	}

	/**
	 * @return 年度收入明细（万元）
	 * @throws ParseException
	 */
	public Object NianDuSHouRuMingXi() throws ParseException {
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		List<Float> nums = new ArrayList<Float>();
		float num = 0;
		float num2 = 0;
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		for (NewCar1 newCar1 : carservice1.findAll()) {
			for (NewCar2 newCar2 : carservice2.findByNewCar(newCar1)) {
				if ("燃油车".equals(newCar2.getType())) {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num += saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);

					}
				} else {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num2 += saleService.XinCheXiaoShouShouRu(sysUser, beginDate1, enDate1);

					}
				}

			}
		}
		name.add("燃油车");
		nums.add(num);
		name.add("新能源车");
		nums.add(num2);
		map.put("燃油车", num);
		map.put("新能源车", num2);
		float fushu = 0;
		float tuijian = 0;
		List<ZhuZhuangTu> yanshenglist = (List<ZhuZhuangTu>) YanShengNianDUShouRuPaiMing();
		for (ZhuZhuangTu tu : yanshenglist) {
			if (tu.getName().contains("险") || tu.getName().contains("金融") || tu.getName().contains("代办")) {
				fushu += tu.getNumber();
			} else {
				tuijian += tu.getNumber();
			}
		}
		name.add("附属衍生");
		nums.add(fushu);

		name.add("推荐衍生");
		nums.add(tuijian);
		map.put("附属衍生", fushu);
		map.put("推荐衍生", tuijian);

		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(ChuLifloatE(nums.get(i)));
		}

		return (zhus);
	}

	/**
	 * @return 年度毛利明细（万元）
	 * @throws ParseException
	 */
	public Object NianDuMaoliMingXi() throws ParseException {
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		List<Float> nums = new ArrayList<Float>();
		float num = 0;
		float num2 = 0;
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		for (NewCar1 newCar1 : carservice1.findAll()) {
			for (NewCar2 newCar2 : carservice2.findByNewCar(newCar1)) {

				if ("燃油车".equals(newCar2.getType())) {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num += saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1);

					}
				} else {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num2 += saleService.XinCheXiaoShouMaoLi(sysUser, beginDate1, enDate1);

					}
				}

			}
		}
		name.add("燃油车");
		nums.add(num);
		name.add("新能源车");
		nums.add(num2);
		map.put("燃油车", num);
		map.put("新能源车", num2);
		float fushu = 0;
		float tuijian = 0;
		List<ZhuZhuangTu> yanshenglist = (List<ZhuZhuangTu>) YanShengNianDUMaoliPaiMing();
		for (ZhuZhuangTu tu : yanshenglist) {
			if (tu.getName().contains("险") || tu.getName().contains("金融") || tu.getName().contains("代办")) {
				fushu += tu.getNumber();
			} else {
				tuijian += tu.getNumber();
			}
		}
		name.add("附属衍生");
		nums.add(fushu);

		name.add("推荐衍生");
		nums.add(tuijian);
		map.put("附属衍生", fushu);
		map.put("推荐衍生", tuijian);

		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(ChuLifloatE(nums.get(i)));
		}

		return (zhus);
	}

	/**
	 * @return 年度毛利率明细（万元）
	 * @throws ParseException
	 */
	public Object NianDuMaoliLvMingXi() throws ParseException {

		List<ZhuZhuangTu> nums = new ArrayList<ZhuZhuangTu>();
		List<ZhuZhuangTu> list = (List<ZhuZhuangTu>) NianDuSHouRuMingXi();
		List<ZhuZhuangTu> list2 = (List<ZhuZhuangTu>) NianDuMaoliMingXi();
		for (int i = 0; i < list.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			if (!list.get(i).getBigNumber().equals("0")) {
				String aa = list.get(i).getBigNumber();
				float a = Float.parseFloat(aa);
				String bb = list2.get(i).getBigNumber();
				float b = Float.parseFloat(bb);
				float c = (b / a);
				zhu.setName(list.get(i).getName());
				zhu.setBigNumber("" + c);
				nums.add(zhu);
			} else {

				zhu.setName(list.get(i).getName());
				zhu.setBigNumber("0");
				nums.add(zhu);
			}

		}
		return (nums);

	}

	/**
	 * @return 年度成本明细（万元）
	 * @throws ParseException
	 */
	public Object NianDuChengBenMingXi() throws ParseException {
		Map<String, Float> map = new LinkedHashMap<String, Float>();
		List<CarsOrder2> list = new ArrayList<CarsOrder2>();
		List<String> name = new ArrayList<String>();
		List<Float> nums = new ArrayList<Float>();
		float num = 0;
		float num2 = 0;
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		for (NewCar1 newCar1 : carservice1.findAll()) {
			for (NewCar2 newCar2 : carservice2.findByNewCar(newCar1)) {

				if ("燃油车".equals(newCar2.getType())) {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num += saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);

					}
				} else {
					List<CarsOrder2> list2 = carorderService2.findByCars(newCar1);
					for (CarsOrder2 carsOrder2 : list2) {
						if (carsOrder2.getXiaoShouPrice() == null) {
							continue;
						}
						Integer year = date.getYear() + 1900;
						Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
						Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");

						SysUser sysUser = carsOrder2.getCarsorder().getUserId();
						num2 += saleService.XinCheXiaoShouChenBen(sysUser, beginDate1, enDate1);
					}

				}

			}
		}
		name.add("燃油车");
		nums.add(num);
		name.add("新能源车");
		nums.add(num2);
		map.put("燃油车", num);
		map.put("新能源车", num2);
		float fushu = 0;
		float tuijian = 0;
		List<ZhuZhuangTu> yanshenglist = (List<ZhuZhuangTu>) YanShengNianDUChengBenPaiMing();
		for (ZhuZhuangTu tu : yanshenglist) {
			if (tu.getName().contains("险") || tu.getName().contains("金融") || tu.getName().contains("代办")) {
				fushu += tu.getNumber();
			} else {
				tuijian += tu.getNumber();
			}
		}
		name.add("附属衍生");
		nums.add(fushu);

		name.add("推荐衍生");
		nums.add(tuijian);
		map.put("附属衍生", fushu);
		map.put("推荐衍生", tuijian);

		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < map.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(ChuLifloatE(nums.get(i)));
		}

		return (zhus);
	}

	/**
	 * 
	 * @param nowTime   当前时间
	 * @param startTime 开始时间
	 * @param endTime   结束时间
	 * @return
	 * @author 判断当前时间在时间区间内
	 */
	public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) {
		if (nowTime.getTime() == startTime.getTime() || nowTime.getTime() == endTime.getTime()) {
			return true;
		}

		Calendar date = Calendar.getInstance();
		date.setTime(nowTime);

		Calendar begin = Calendar.getInstance();
		begin.setTime(startTime);

		Calendar end = Calendar.getInstance();
		end.setTime(endTime);

		if (date.after(begin) && date.before(end)) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * @return 销售部试乘试驾量
	 * @throws ParseException
	 */
	public Object XiaoSHouBuShiCHengShiJiaLiang() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.ShiChengShiJiaNum(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);

	}

	/**
	 * @return 客户邀约到店量倒数TOP3
	 * @throws ParseException
	 */
	public Object KeHuYaoYueDaoDianLiangDaoShuPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.YaoYueDaoDianliang(sysUser, beginDate1, enDate1);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearchDaoShu(paiming);
		return (paiming);

	}

	/**
	 * @return 客户A级数量倒数TOP3
	 * @throws ParseException
	 */
	public Object KeHuAJiShuLiangDaoShuPaiMing() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.ALevel(sysUser, beginDate1, enDate1);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearchDaoShu(paiming);
		return (paiming);

	}

	/**
	 * @return 年度线索转化效率
	 * @throws ParseException
	 */
	public Object NianDuXianSuoZhuanHuanXiaolv() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<String> name = new ArrayList<String>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer xiansuo = 0;
		Integer liudang = 0;
		Integer yaoyue = 0;
		Integer chengjiao = 0;
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			 xiansuo += saleService.ZhanTingXianSuo(sysUser, beginDate1, enDate1);
			 liudang += saleService.ZhanTingLiudangNums(sysUser, beginDate1, enDate1);
			 yaoyue+= saleService.YaoYueDaoDianliang(sysUser, beginDate1, enDate1);
			 chengjiao += saleService.newCarNums(sysUser, beginDate1, enDate1);
		}
		name.add("线索");
		nums.add(xiansuo);
		name.add("留档");
		nums.add(liudang);
		name.add("邀约到店");
		nums.add(yaoyue);
		name.add("成交");
		nums.add(chengjiao);
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int i = 0; i < name.size(); i++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(i).setName(name.get(i));
			zhus.get(i).setBigNumber(nums.get(i).toString());
		}

		return (zhus);

	}

	/**
	 * @return 销售部年线上线索来源一览
	 * @throws ParseException 
	 */
	public Object XiaoShouBuNianXianSuoLaiYuanXIanShang() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.LaiDianXianSuo(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}
	/**
	 * @return 销售部年线下线索来源一览
	 * @throws ParseException 
	 */
	public Object XiaoShouBuNianXianSuoLaiYuanXIanXian() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer yiyue = 0;
		Integer eryue1 = 0;
		Integer sanyue1 = 0;
		Integer siyue1 = 0;
		Integer wuyue1 = 0;
		Integer liuyue1 = 0;
		Integer qiyue1 = 0;
		Integer bayue1 = 0;
		Integer jiuyue1 = 0;
		Integer shiyue1 = 0;
		Integer shiyi = 0;
		Integer shier = 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Integer yiyue1 = saleService.LaiDian1XianSuo(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
		return (nums);
	}
	
	/**
	 * @return 销售部年线索来源一览
	 * @throws ParseException 
	 */
	public Object XIaoShouBuNianXianSuoLaiYuan() throws ParseException {
		List<Integer> xianshang=(List<Integer>) XiaoShouBuNianXianSuoLaiYuanXIanShang();
		List<Integer> xianxia=(List<Integer>) XiaoShouBuNianXianSuoLaiYuanXIanXian();
		List<List<Integer>> list=new ArrayList<List<Integer>>();
		list.add(xianshang);
		list.add(xianxia);
		return list;
	}
	/**
	 * @return TOP4销售顾问与展厅销量占比，饼图
	 * @throws ParseException
	 */
	public Object XiaoShouGuwenCheLiangYuZongLiang() throws ParseException {

		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.newCarNums(sysUser, beginDate1, enDate1);
			num+=saleService.newCarNums(sysUser, beginDate1, enDate1);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearch(paiming);
		List<RenYuanPaiMing> paiming2 = new ArrayList<RenYuanPaiMing>();
		for (int j = 0; j < paiming.size(); j++) {
			RenYuanPaiMing ren=new RenYuanPaiMing();
			String aa=paiming.get(j).getNum1();
			float a = Float.parseFloat(aa);
			float num1=num;
			float b=a/num1;
			ren.setSysuer(paiming.get(j).getSysuer());
			ren.setNum1(String.valueOf(b));
			paiming2.add(ren);
		}
		
		return (paiming2);

	
	}
	/**
	 * @return TOP4销售顾问与转介绍销量占比，饼图
	 * @throws ParseException
	 */
	public Object XiaoShouGuwenZhuanJieShaoYuZongLiang() throws ParseException {

		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Integer> nums = new ArrayList<Integer>();
		List<Integer> nums2 = new ArrayList<Integer>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Integer num = 0;
		
		for (SysUser sysUser : list) {
			Integer year = date.getYear() + 1900;
			Date beginDate1 = dateformat.parse(year + "-01-01 00:00:00");
			Date enDate1 = dateformat.parse(year + "-12-31 00:00:00");
			Integer carNums = saleService.ZhuanJieShao(sysUser, beginDate1, enDate1);
			num+=saleService.ZhuanJieShao(sysUser, beginDate1, enDate1);
			nums.add(carNums);
			sysuers.add(sysUser);
		}
		List<RenYuanPaiMing> paiming = new ArrayList<RenYuanPaiMing>();
		for (int i = 0; i < sysuers.size(); i++) {
			RenYuanPaiMing ren = new RenYuanPaiMing();
			ren.setSysuer(sysuers.get(i));
			ren.setNum1(nums.get(i).toString());
			paiming.add(ren);
		}
		paiming = RenYuansearch(paiming);
		List<RenYuanPaiMing> paiming2 = new ArrayList<RenYuanPaiMing>();
		for (int j = 0; j < paiming.size(); j++) {
			RenYuanPaiMing ren=new RenYuanPaiMing();
			String aa=paiming.get(j).getNum1();
			float a = Float.parseFloat(aa);
			float num1=num;
			float b=a/num1;
			ren.setSysuer(paiming.get(j).getSysuer());
			ren.setNum1(String.valueOf(b));
			paiming2.add(ren);
		}
		
		return (paiming2);

	
	}
	/**
	 * @return 销售部年度综合收入一览（万元）（分12个月）
	 * @throws ParseException
	 */
	public Object XiaoShouBuNianDuZongHeShouRuShiJi1() throws ParseException {
		DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date date = new Date();// 获取当前时间
		List<SysUser> list = sysUserService.findByDeptName("销售部");
		List<Float> nums = new ArrayList<Float>();
		List<SysUser> sysuers = new ArrayList<SysUser>();
		Float yiyue =  (float) 0;
		Float eryue1 = (float) 0;
		Float sanyue1 = (float) 0;
		Float siyue1 = (float) 0;
		Float wuyue1 = (float) 0;
		Float liuyue1 = (float) 0;
		Float qiyue1 = (float) 0;
		Float bayue1 = (float) 0;
		Float jiuyue1 = (float) 0;
		Float shiyue1 = (float) 0;
		Float shiyi = (float) 0;
		Float shier = (float) 0;
		for (SysUser sysUser : list) {
			int year = date.getYear() + 1900;
			Integer month = date.getMonth() + 1;
			int d = 30;
			for (int i = 1; i <= 12; i++) {
				if (i == 2) {
					d = 28;
				} else if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) {
					d = 31;
				} else {
					d = 30;
				}
				Date beginDate1 = dateformat.parse(year + "-" + i + "-01 00:00:00");
				Date enDate1 = dateformat.parse(year + "-" + i + "-" + d + " 00:00:00");
				if (i == 1) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					yiyue += yiyue1;
				}
				if (i == 2) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					eryue1 += yiyue1;
				}
				if (i == 3) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					sanyue1 += yiyue1;
				}
				if (i == 4) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					siyue1 += yiyue1;
				}
				if (i == 5) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					wuyue1 += yiyue1;
				}
				if (i == 6) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					liuyue1 += yiyue1;
				}
				if (i == 7) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					qiyue1 += yiyue1;
				}
				if (i == 8) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					bayue1 += yiyue1;
				}
				if (i == 9) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					jiuyue1 += yiyue1;
				}
				if (i == 10) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					shiyue1 += yiyue1;
				}
				if (i == 11) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					shiyi += yiyue1;
				}
				if (i == 12) {
					Float yiyue1 = saleService.XiaoShouZongHeShouRu(sysUser, beginDate1, enDate1);
					shier += yiyue1;
				}
			}
		}
		nums.add(yiyue);
		nums.add(eryue1);
		nums.add(sanyue1);
		nums.add(siyue1);
		nums.add(wuyue1);
		nums.add(liuyue1);
		nums.add(qiyue1);
		nums.add(bayue1);
		nums.add(jiuyue1);
		nums.add(shiyue1);
		nums.add(shiyi);
		nums.add(shier);
	
		return nums;

	}

	
	/**
	 * bean的集合按照指定bean的字段排序
	 * 
	 * @param list      要排序的集合
	 * @param filedName 字段名称
	 * @param ascFlag   是否升序
	 */
	public static void sort1(List list, String filedName, boolean ascFlag) {
		if (list.size() == 0 || filedName.equals("")) {
			return;
		}
		Comparator<?> cmp = ComparableComparator.getInstance();
		if (ascFlag) {
			cmp = ComparatorUtils.nullLowComparator(cmp);
		} else {
			cmp = ComparatorUtils.reversedComparator(cmp);

		}
		Collections.sort(list, new BeanComparator(filedName, cmp));
	}

	/**
	 * @param logsList
	 * @return 人员排名
	 */
	public List<RenYuanPaiMing> RenYuansearch(List<RenYuanPaiMing> logsList) {
		Collections.sort(logsList, new Comparator<RenYuanPaiMing>() {
			@Override
			public int compare(RenYuanPaiMing o1, RenYuanPaiMing o2) {
				if (Integer.valueOf(o1.getNum1()) > Integer.valueOf(o2.getNum1())) {
					return -1;
				}
				if (Integer.valueOf(o1.getNum1()) == Integer.valueOf(o2.getNum1())) {
					return 0;
				}
				return 1;
			}
		});
		return logsList;
	}

	public List<RenYuanPaiMing> RenYuansearchDaoShu(List<RenYuanPaiMing> logsList) {
		Collections.sort(logsList, new Comparator<RenYuanPaiMing>() {
			@Override
			public int compare(RenYuanPaiMing o1, RenYuanPaiMing o2) {
				if (Integer.valueOf(o1.getNum1()) < Integer.valueOf(o2.getNum1())) {
					return -1;
				}
				if (Integer.valueOf(o1.getNum1()) == Integer.valueOf(o2.getNum1())) {
					return 0;
				}
				return 1;
			}
		});
		return logsList;
	}

	/**
	 * @param logsList
	 * @return 柱状图排名
	 */
	public List<ZhuZhuangTu> ZhuZHuangTusearch(List<ZhuZhuangTu> logsList) {
		Collections.sort(logsList, new Comparator<ZhuZhuangTu>() {
			@Override
			public int compare(ZhuZhuangTu o1, ZhuZhuangTu o2) {
				if (o2.getBigNumber() == null) {
					o2.setBigNumber("0");
				}
				if (o1.getBigNumber() == null) {
					o1.setBigNumber("0");
				}
				if (Float.valueOf(o1.getBigNumber()) > Float.valueOf(o2.getBigNumber())) {
					return -1;
				}
				if (Float.valueOf(o1.getBigNumber()) == Float.valueOf(o2.getBigNumber())) {
					return 0;
				}
				return 1;
			}
		});
		return logsList;
	}

	/**
	 * @param num
	 * @return 处理float类型大数字出现E
	 */
	public String ChuLifloatE(float num) {
		BigDecimal bg = new BigDecimal(num + "");
		DecimalFormat df = new DecimalFormat("0.00");
		String res = df.format(bg);
		return res;
	}

	public Object YuefenCHuli(List<Integer> nums) {
		List<ZhuZhuangTu> zhus = new ArrayList<ZhuZhuangTu>();
		for (int j = 0; j < nums.size(); j++) {
			ZhuZhuangTu zhu = new ZhuZhuangTu();
			zhus.add(zhu);
			zhus.get(j).setName((j + 1) + "");
			zhus.get(j).setBigNumber(nums.get(j).toString());
		}
		List<ZhuZhuangTu> zhus2 = new ArrayList<ZhuZhuangTu>();
		for (int k = 0; k < zhus.size(); k++) {
			if (!zhus.get(k).getBigNumber().equals("0")) {
				zhus2.add(zhus.get(k));
			}
		}
		if (zhus2.size() < 3) {
			for (int k = 0; k < zhus.size(); k++) {
				if (zhus.get(k).getBigNumber().equals("0")) {
					zhus2.add(zhus.get(k));
					break;
				}
			}
		}
		return (zhus2);
	}
}
